How to suppress / hide the query output in bq command line - Bigquery

While using the bq CLI to execute queries, bq query displays the query output every time. In order to suppress/hide output from bq query command,

Use the -n=0 option to bq query. Here is an example with and without this option:

$ bq query --use_legacy_sql=false "SELECT x FROM UNNEST([1, 2, 3]) AS x;"
Waiting on <job id> ... (0s) Current status: DONE   
+---+
| x |
+---+
| 1 |
| 2 |
| 3 |
+---+

With suppressed log: 

$ bq query -n=0 --use_legacy_sql=false "SELECT x FROM UNNEST([1, 2, 3]) AS x;"
Waiting on <job id> ... (0s) Current status: DONE

Ryan-Dallas

posted on 10 Apr 19

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds